package welsir.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import welsir.entity.dos.ArticleComment;
import welsir.mapper.ArticleCommentMapper;
import welsir.service.IArticleCommentService;

import javax.annotation.Resource;

/**
 * @author Genius
 * @date 2023/03/07 21:41
 **/
@Service
public class IArticleCommentServiceImpl extends ServiceImpl<ArticleCommentMapper, ArticleComment> implements IArticleCommentService {

        @Resource
        private ArticleCommentMapper articleCommentMapper;

        @Override
        public int GetCommentNum(Integer articleId) {
            QueryWrapper<ArticleComment> wrapper = new QueryWrapper<>();
            wrapper.eq("article_id",articleId);
            return articleCommentMapper.selectCount(wrapper);
        }
}
